# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=cbindgen
# Please be VERY careful bumping this - Firefox regularly fails to build
# with new versions!
pkgver=0.14.3
pkgrel=0
pkgdesc="Tool to generate C bindings from Rust code"
url="https://github.com/eqrion/cbindgen"
arch="x86_64 armv7 armhf aarch64 x86 ppc64le" # Limited by cargo
license="MPL-2.0"
makedepends="cargo"
source="$pkgname-$pkgver.tar.gz::https://crates.io/api/v1/crates/cbindgen/$pkgver/download"

build() {
	cargo build --release --locked --verbose
}

check() {
	# Failing tests
	rm -rf tests/rust/expand*
	cargo test --release --locked --verbose
}

package() {
	install -Dm0755 target/release/cbindgen -t "$pkgdir"/usr/bin
}

sha512sums="abce798aff93260c28b0717df5fd25cf24b3eb89c9d05df4832d06169ec30db8e1c17a300f88087c6fbd4414a6aae6788e162dde838aac01c499afcb145c8461  cbindgen-0.14.3.tar.gz"
